package com.example.livereplay.common.controller;

import com.example.livereplay.common.model.enity.LiveStream;
import com.example.livereplay.common.model.enity.Place;
import com.example.livereplay.common.service.PlaceService;
import com.wingice.common.web.ErrorCodeInfo;
import com.wingice.common.web.ResultBean;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

@RestController
@RequestMapping("/place")
@Tag(name = "场地管理")
public class PlaceController {
    @Resource
    private PlaceService placeService;
    @Operation(summary = "根据场地查找直播")
    @PostMapping("/getPlaceById")
    public ResultBean<List<Place>> getLiveStreamByPlaceId(@RequestBody @Valid String tournamentId){
        return ResultBean.restResult(placeService.getPlaceByTournamentId(tournamentId), ErrorCodeInfo.OK);
    }
}
